package org.dengues.designer.ui.database.editors;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.part.FileEditorInput;

public class DenguesSqlEditor extends TextEditor {

    /**
     * Qiang.Zhang.Adolf@gmail.com DenguesSqlEditor constructor comment.
     */
    public DenguesSqlEditor() {
    }

    @Override
    public void doSetInput(IEditorInput input) throws CoreException {
        if (input instanceof DBFileEditorInput) {
            DBFileEditorInput editorInput = (DBFileEditorInput) input;
            input = new FileEditorInput(editorInput.getSqlScriptFile());
        }
        super.doSetInput(input);
    }

    @Override
    public boolean isEditable() {
        return false;
    }
}
